<include file="Public/header" />
<title>我的桌面</title>
</head>
<body>
<div class="pd-20">

		<table class="table table-border table-bordered table-hover table-bg" style="margin-top:20px;">
		<thead>
			<tr>
				<th scope="col" colspan="16">产品列表</th>
			</tr>
			<tr class="text-c">
				<th width="40">ID</th>
				<th width="40">单号</th>
				<th width="40">申请部门</th>
				<th width="100">批次</th>
				<th width="40">申请人</th>
				<th width="40">制单人</th>
				<th width="40">入库仓库</th>
				<th width="40">产品名称</th>
				<th width="40">产品规格</th>
				<th width="40">料号</th>
				<th width="40">产品编码</th>
				<th width="40">计划数量</th>
				<th width="40">主单位</th>
				<th width="40">生产周期要求</th>
				<th width="40">申请摘要</th>

				<th width="40">备注</th>
			</tr>
		</thead>
		<tbody>
			<tr class="text-c">
				<td><{$detail.id}></td>
				<td><{$detail.purchasing_no}></td>
				<td>
					<select  class="input-text" id="section_no" name="section_no">
						<option value="0">请选择</option>
						<volist name="section_list" id="vo">
							<option value="<{$vo.no}>" <if condition="$vo['no'] eq $detail['section_no']">selected</if>><{$vo.name}></option>
						</volist>
					</select>
				</td>
				<td><{$detail.batch_no}></td>
				<td>
					<select  class="input-text people_purchasing_no" id="people_purchasing_no" name="people_purchasing_no">
						<option value="0">请选择</option>
						<volist name="personnel_list" id="vo">
							<option value="<{$vo.no}>" <if condition="$vo['no'] eq $detail['people_purchasing_no']">selected</if>><{$vo.name}></option>
						</volist>
					</select>
				</td>
				<td>
					<select  class="input-text people_make_no" id="people_make_no" name="people_make_no">
							<option value="0">请选择</option>
							<volist name="personnel_list" id="vo">
								<option value="<{$vo.no}>" <if condition="$vo['no'] eq $detail['people_make_no']">selected</if>><{$vo.name}></option>
							</volist>
						</select>
				</td>
				<td>
					<select  class="input-text inbound_warehouse_code" id="inbound_warehouse_code" name="inbound_warehouse_code">
							<option value="0">请选择</option>
							<volist name="warehouse_list" id="vo">
								<option value="<{$vo.warehouse_code}>" <if condition="$vo['warehouse_code'] eq $detail['inbound_warehouse_code']">selected</if>><{$vo.name}></option>
							</volist>
						</select>
				</td>
				<td>
					<input type="text"  class="input-text" name="pro_name" value="<{$detail.pro_name}>" >
				</td>
				<td>
					<input type="text"  class="input-text" name="pro_spec" value="<{$detail.pro_spec}>" >
				</td>
				<td>
					<input type="text"  class="input-text" name="source_no" value="<{$detail.source_no}>" >
				</td>
				<td>
					<input type="text"  class="input-text" name="pro_no" value="<{$detail.pro_no}>" >
				</td>
				<td>
					<input type="text" class="input-text"  placeholder="计划数量" id="pro_num_plan" name="pro_num_plan" value="<{$detail.pro_num_plan}>" >
				</td>
				<td>
				<select  class="input-text unit1" id="unit1" name="unit1">
								<option value="0">请选择</option>
								<volist name="unit_list" id="vo">
									<option value="<{$vo.unit_no}>" <if condition="$vo['unit_no'] eq $detail['unit1']">selected</if>><{$vo.unit_name}></option>
								</volist>
							</select>
				</td>
				<td>
					<input type="text" class="input-text"  placeholder="生产周期要求" id="product_weeks" name="product_weeks"  value="<{$detail.product_weeks}>" >
				</td>
				<td>
					<input type="text" class="input-text"  placeholder="申请摘要" id="product_marks" name="product_marks"  value="<{$detail.product_marks}>" >
				</td>
				<td>
					<input type="text" class="input-text"  placeholder="备注" id="mark" name="mark"  value="<{$detail.mark}>" >
				</td>
			</tr>
			
<volist name="byproduct_list" id="vs">
				<tr class="text-c">
				<td><{$vs.id}>副</td>
				<td><{$detail.purchasing_no}></td>
				<td>

						<volist name="section_list" id="vo">
							<if condition="$vo['no'] eq $detail['section_no']"><{$vo.name}></if>
						</volist>
					</select>
				</td>
				<td><{$detail.batch_no}></td>
				<td>
						<volist name="personnel_list" id="vo">
							<if condition="$vo['no'] eq $detail['people_purchasing_no']"><{$vo.name}></if>
						</volist>
				</td>
				<td>
							<volist name="personnel_list" id="vo">
								<if condition="$vo['no'] eq $detail['people_make_no']"><{$vo.name}></if>
							</volist>
				</td>
				<td>
							<volist name="warehouse_list" id="vo">
								<if condition="$vo['warehouse_code'] eq $detail['inbound_warehouse_code']"><{$vo.name}></if>
							</volist>
				</td>
				<td>
					<input type="text"  class="input-text" name="pro_name" value="<{$vs.pro_name}>" >
				</td>
				<td>
					<input type="text"  class="input-text" name="pro_spec" value="<{$vs.pro_spec}>" >
				</td>
				<td>
					<input type="text"  class="input-text" name="source_no" value="<{$vs.source_no}>" >
				</td>
				<td>
					<input type="text"  class="input-text" name="pro_no" value="<{$vs.pro_no}>" >
				</td>
				<td>
					<input type="text" class="input-text"  placeholder="计划数量" id="pro_num_plan" name="pro_num_plan" value="<{$vs.pro_num_plan}>" >
				</td>
				<td>
				<select  class="input-text unit1" id="unit1" name="unit1">
								<option value="0">请选择</option>
								<volist name="unit_list" id="vo">
									<option value="<{$vo.unit_no}>" <if condition="$vo['unit_no'] eq $vs['unit1']">selected</if>><{$vo.unit_name}></option>
								</volist>
							</select>
				</td>
				<td>
					<input type="text" class="input-text"  placeholder="生产周期要求" id="product_weeks" name="product_weeks"  value="<{$vs.product_weeks}>" >
				</td>
				<td>
					<input type="text" class="input-text"  placeholder="申请摘要" id="product_marks" name="product_marks"  value="<{$vs.product_marks}>" >
				</td>
				<td>
					<input type="text" class="input-text"  placeholder="备注" id="mark" name="mark"  value="<{$vs.mark}>" >
				</td>
			</tr>
			</volist>
		</tbody>
	</table>
	<a href="javascript:;" onclick="admin_open('添加产品','__URL__/add_byproduct/id/'+<{:I('id')}>,0,'1000','650')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加产品</a>
<div class="pages">
<{$page}>
</div>
</div>
<include file="Public/footer" />
<include file="Public/footer_js" />
<script type="text/javascript">
    $(function(){
		$(".del").click(function(){
			$(this).parent().remove();
		 })
		/*保存计划入库单数据*/
        $("#bedit").click(function(){
			var section_no=$('input[name=section_no]').val();
			var people_purchasing_no=$('.people_purchasing_no').val();
			var people_make_no=$('.people_make_no').val();
			var inbound_warehouse_code=$('.inbound_warehouse_code').val();
			
			var pro_name=$('input[name=pro_name]').val();
			var pro_spec=$('input[name=pro_spec]').val();
			var source_no=$('input[name=source_no]').val();
			var pro_no=$('input[name=pro_no]').val();
			var pro_num_plan=$('input[name=pro_num_plan]').val();
			
			var unit1=$('.unit1').val();
			var product_weeks=$('input[name=product_weeks]').val();
			var product_marks=$('input[name=product_marks]').val();
			var mark=$('input[name=mark]').val();
			
		
			if(count<1){
				layer.msg('没有添加原料');
				return false;
			}

			
			$.ajax({
                type: 'POST',
                data: {
						id:<{:I('id')}>,
						section_no: section_no,
						people_make_no:people_make_no,
						people_purchasing_no:people_purchasing_no,
						inbound_warehouse_code:inbound_warehouse_code,
						pro_name: pro_name,
						pro_spec: pro_spec,
						source_no: source_no,
						pro_no:pro_no,
						pro_num_plan: pro_num_plan,
						unit1:unit1,
						product_weeks:product_weeks,
						product_marks:product_marks,
						batch_no: batch_no,
						mark:mark
					  },
                url: "<{:U('edt_view')}>",
                success:function(data){
                    layer.msg(data.info,function(){
						if(data.status==0){
							return false;
						}else{
							self.window.location.href =self.window.location.href;
						}
						
					});
                }
            })
            
        });
    })

	 $(".addimg").click(function(){
				var price=$('input[name=price]');
				if(price.length<1){
					layer.msg('请先添加原料');
					return false;
				}
				$(".tabCon").attr('style','display:block');
				return false;
	})
</script>
</body>
</html>
</html>